<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('审核服务商尾款充值抵扣')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <h4 class="form-header h4">基本信息</h4>
        <form class="form-horizontal m" id="form-audit-update" th:object="${agentApplyTailmoney}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">服务商编号：</label>
                <div class="col-sm-8">
                    <input name="agentNum" th:field="*{agentNum}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">服务商名称：</label>
                <div class="col-sm-8">
                    <input name="agentName" th:field="*{agentName}" class="form-control" type="text" readonly>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">未结清尾款：</label>
                <div class="col-sm-8">
                    <input name="surplusMoney" th:field="*{surplusMoney}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">申请抵扣尾款金额：</label>
                <div class="col-sm-8">
                    <input name="applyMoney" th:field="*{applyMoney}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">操作类型：</label>
                <div class="col-sm-8">
                <label class="radio-box"> <input type="radio" name="applyStatus" value="1"/> 通过 </label>
                    <label class="radio-box"> <input type="radio" name="applyStatus" value="2"/> 打回</label>
                </div>
            </div>
            <h4 class="form-header h4">支付凭证</h4>
            <img id="img" th:data-original="*{fileid}" th:src="*{fileid}"></li>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var viewer = new Viewer(document.getElementById('img'), {
            url: 'th:data-original'
        });
        var prefix = ctx + "AgentApplyTailmoney/AgentApplyTailmoney";
        function submitHandler() {
            add();
        }

        function add() {
            var id = $("input[name='id']").val();
            var status = $('input[name="applyStatus"]:checked ').val();
            if(typeof(status) == "undefined"){
                $.modal.alertError("请选择审核状态!");
                return;
            }
            $.ajax({
                cache : true,
                type : "POST",
                url : prefix + "/edit",
                data : $("#form-audit-update").serialize(),
                async : false,
                error : function(request) {
                    $.modal.alertError("系统错误");
                },
                success : function(data) {
                    $.operate.successCallback(data);
                }
            });
            $.modal.closeLoading();
        }
    </script>
</body>
</html>